Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

363
Visualizações
how to solve 500 internal server error mod_wsgi apache "importerror: No Module named 'django'

I have been trying to solve this error but I am not been able to solve, totally frustrated because I have tried every single answer on these related question , any help would be appreciated.

My configuration of VPS server

Ubuntu 18.04
django 2.2.5
apache 2.4.49
python 3.6(virtualenv)
libapache2-mod-wsgi-py3 

My folder structure is:

/var/www/dataforze/prediction_project/venv (virtualenv folder)
    bin
    include
    lib

/var/www/dataforze/prediction_project
    |- manage.py
    static
    venv
    prediction_project
        |__init__.py
        |settings.py
        |urls.py
        |wsgi.py

000-default.conf file code

<VirtualHost *:80>

    <Directory /var/www/dataforze/prediction_project/prediction_project>
            Require all granted
    </Directory>


    <Directory /var/www/dataforze/prediction_project/prediction_project>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    WSGIDaemonProcess prediction_project python-path=/var/www/dataforze/prediction_project python-home=/var/www/dataforze/prediction_project/venv
    WSGIProcessGroup prediction_project
    WSGIScriptAlias / /var/www/dataforze/prediction_project/prediction_project/wsgi.py

   ErrorLog ${APACHE_LOG_DIR}/mysite_error.log
   LogLevel warn

</VirtualHost>

my wsgi.py file code import os

from django.core.wsgi import get_wsgi_application

sys.path.append('/var/www/dataforze/prediction_project/prediction_project')

# add the virtualenv site-packages path to the sys.path
sys.path.append('/var/www/dataforze/prediction_project/venv/lib/site-packages')

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'prediction_project.settings')

application = get_wsgi_application()

My server logs

[Wed Mar 18 17:29:01.003624 2020] [wsgi:error] [pid 82169:tid 140431942575872]  mod_wsgi (pid=82169): Target WSGI script '/var/www/dataforze/prediction_project/prediction_project/wsgi.py' cannot be loaded as Python module.
[Wed Mar 18 17:29:01.003722 2020] [wsgi:error] [pid 82169:tid 140431942575872]  mod_wsgi (pid=82169): Exception occurred processing WSGI script '/var/www/dataforze/prediction_project/prediction_project/wsgi.py'.
[Wed Mar 18 17:29:01.003823 2020] [wsgi:error] [pid 82169:tid 140431942575872]  Traceback (most recent call last):
[Wed Mar 18 17:29:01.003844 2020] [wsgi:error] [pid 82169:tid 140431942575872]  File "/var/www/dataforze/prediction_project/prediction_project/wsgi.py", line 12, in <module>
[Wed Mar 18 17:29:01.003849 2020] [wsgi:error] [pid 82169:tid 140431942575872]    from django.core.wsgi import get_wsgi_application
[Wed Mar 18 17:29:01.003864 2020] [wsgi:error] [pid 82169:tid 140431942575872]  ModuleNotFoundError: No module named 'django'
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda